<template>
  <div>
    <div>
      <el-tooltip content="下载报告" effect="dark" placement="bottom">
        <el-button class="print" type="primary" icon="el-icon-download" circle @click="expWord" />
      </el-tooltip>
    </div>

    <detail :e-id="this.$route.params.id" />
  </div>
</template>

<script>
import $ from 'jquery'
require('@/assets/js/jquery.wordexport')
import detail from "./detail";
export default {
  name: "Preview",
  components: {
    detail
  },
  data() {
    return {};
  },
  methods: {
    expWord() {
      $('#print').wordExport('word文档')
    },
    print() {
      // this.$router.push(`/reportDownload/${this.$route.params.id}`)
      let printHtml = this.$router.resolve({
        path: "/reportDownload",
        query: { id: this.$route.params.id }
      });
      window.open(printHtml.href, "_blank");
    }
  }
};
</script>

<style lang="scss" scoped>
.print {
  position: fixed;
  right: 40px;
  bottom: 40px;
  padding: 15px;
  font-size: 1.2em;
}
</style>
